package com.tenglong.teacher.services;

import com.tenglong.teacher.data.requestInfo.AnswerQuestionItem;
import com.tenglong.teacher.data.requestInfo.CreateRequestInfo;
import com.tenglong.teacher.data.requestInfo.ModifyPassword;
import com.tenglong.teacher.data.requestInfo.SysOfficeEntity;
import com.tenglong.teacher.data.resultInfo.AnswerInfo;
import com.tenglong.teacher.data.resultInfo.ClassInfo;
import com.tenglong.teacher.data.resultInfo.ClientCuotiInfo;
import com.tenglong.teacher.data.resultInfo.ClientUserInfo;
import com.tenglong.teacher.data.resultInfo.CurrentHomeWorkOutsideInfo;
import com.tenglong.teacher.data.resultInfo.CurrentVersionInfo;
import com.tenglong.teacher.data.resultInfo.DictByType;
import com.tenglong.teacher.data.resultInfo.HistoryHomeWorkClassHourInfo;
import com.tenglong.teacher.data.resultInfo.HistoryHomeWorkOutsideInfo;
import com.tenglong.teacher.data.resultInfo.HomeWorkIM;
import com.tenglong.teacher.data.resultInfo.HomeworkDetailInfo;
import com.tenglong.teacher.data.resultInfo.InfomMessageInfo;
import com.tenglong.teacher.data.resultInfo.NeteaseIM;
import com.tenglong.teacher.data.resultInfo.PublishHomeworkResurtInfo;
import com.tenglong.teacher.data.resultInfo.RelateHeaderData;
import com.tenglong.teacher.data.resultInfo.SeClass;
import com.tenglong.teacher.data.resultInfo.SeCourse;
import com.tenglong.teacher.data.resultInfo.SeData;
import com.tenglong.teacher.data.resultInfo.StudentSignBottomInfo;
import com.tenglong.teacher.data.resultInfo.StudentSignInfo;
import com.tenglong.teacher.data.resultInfo.VerifyMessageInfo;
import com.tenglong.teacher.data.resultInfo.base.BaseResult;
import com.tenglong.teacher.data.resultInfo.homework.HomeworkInfo;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface WebRestApi {
    @POST("/mobile/teacher/user/loginNew")
    Call<BaseResult<List<ClientUserInfo>>> login(@Body ClientUserInfo userInfo);


    @POST("/mobile/teacher/user/modify")
    Call<BaseResult<ClientUserInfo>> modifyUserInfo(@Body ClientUserInfo userInfo);

    @POST("/mobile/teacher/user/password")
    Call<BaseResult<ClientUserInfo>> modifyPassword(@Body ModifyPassword userInfo);

    @GET("/mobile/cuoti/{userId}/list")
    Call<List<ClientCuotiInfo>> getCuotiList(@Path("userId") String userId,
                                             @Query("date") int date,
                                             @Query("type") int type);

    @GET("/mobile/cuoti/{userId}/{cuotiId}")
    Call<ClientCuotiInfo> getCuoti(@Path("userId") String userId, @Path("cuotiId") int cuotiId);

    @Multipart
    @POST("/mobile/cuoti/{userId}/upload")
    Call<Boolean> uploadCuoti(@Path("userId") String userId,
                              @Part("type") int type,
                              @PartMap Map<String, RequestBody> images);

    @DELETE("/mobile/cuoti/{userId}/{cuotiId}")
    Call<Boolean> deleteCuoti(@Path("userId") String userId, @Path("cuotiId") int cuotiId);

    @GET("/mobile/cuoti/{userId}/compose")
    Call<String> composeCuoti(@Path("userId") String userId,
                              @Query("subject") String subject,
                              @Query("dateStart") int dateStart,
                              @Query("dateEnd") int dateEnd,
                              @Query("email") String email);

    @Multipart
    @POST("/mobile/teacher/user/uploadImage")
    Call<BaseResult<ClientUserInfo>> uploadPhotoImage(@Part MultipartBody.Part file);


    //二期新增
    @POST("/mobile/teacher/getCourseByPhone")
    Call<BaseResult<List<SeCourse>>> getCourseByPhone(@Query("phone") String phone);

    //二期新增  30a5941627ac4a56a2cedaba9a1984b1 type = 1 表示我的班课 2 表示我对一对一  type = 0 表示1和2的总和
    @POST("/mobile/teacher/getMyClasses")
    Call<BaseResult<List<SeClass>>> getAllClassByUserId(@Query("type") String type);
    @POST("/mobile/teacher/getMyClasses")
    Call<BaseResult<List<ClassInfo>>> getClassRecordByLoginName(@Query("type") String type);
    //我的答疑--->已解答与未解答
    @POST("/mobile/answerquestion/teacher/getTeacherMyListAQ")
    Call<BaseResult<List<AnswerInfo>>> getAnswerListInfo(@Query("courseId") String courseId, @Query("idate") int idate, @Query("statusid") String statusid);


    @POST("/homework/query")
    Call<SeData> getHomeworkInfor(@Query("userId") String userId, @Query("classId") String classId, @Query("type") String type);

    /**
     * 历史作业详情
     *
     * @return
     */
    @POST("/homework/queryByClassRecordId")
    Call<BaseResult<HomeworkInfo>> getStudentListByHomeworkID(@Query("classRecordId") String classRecordId);
    /**
     * 当前作业详情
     *
     * @return
     */
    @POST("/homework/queryByClassIdAndHomeworkId")
    Call<BaseResult<HomeworkInfo>> queryByClassIdAndHomeworkId(@Query("classId") String classId,@Query("homeworkId") String homeworkId);

    //我的答疑--->已收藏
    @POST("/mobile/answerquestion/getMyAQFavorite")
    Call<BaseResult<List<AnswerInfo>>> getCollectListInfo(@Query("userId") String userId, @Query("courseId") String courseId, @Query("idate") int idate);

    /**
     * 相关答疑数据获取
     *
     * @param courseId
     * @param idate
     * @param gradeid
     * @return
     */
    @POST("/mobile/answerquestion/teacher/getTeacherListAQ")
    Call<BaseResult<List<AnswerInfo>>> getRelateAnswerList(@Query("courseId") String courseId, @Query("idate") int idate, @Query("gradeid") String gradeid);

    /**
     * 相关答疑筛选信息获取
     *
     * @return
     */
    @POST("/mobile/teacher/getCourseAndGradeByUserId")
    Call<BaseResult<RelateHeaderData>> getCourseAndGradeByUserId();

    /**
     * 创建班级所需数据
     * @return
     */
    @POST("/mobile/teacher/getAllGradeAndAllCourse")
    Call<BaseResult<RelateHeaderData>> getAllGradeAndAllCourse();


    /**
     * 收藏接口collectState == true,收藏; collectState == false,取消收藏;
     *
     * @param aqId
     * @param collectState
     * @return
     */
    @POST("/mobile/answerquestion/setAQFavoriteState")
    Call<BaseResult<String>> setCollectState(@Query("aqId") String aqId, @Query("collectState") boolean collectState);

    /**
     * 获取签到列表
     *
     * @param classId
     * @return
     */
    @POST("/mobile/teacher/getClassRecordAndStudent")
    Call<BaseResult<StudentSignInfo>> getStudentRecordByClassId(@Query("classId") String classId);

    /**
     * 上课或下课按钮
     *
     * @param classRecordId
     * @param checked
     * @return
     */
    @POST("mobile/teacher/setStartTimeOrEndTime")
    Call<BaseResult<String>> classOverOrUp(@Query("classRecordId") String classRecordId, @Query("checked") String checked, @Query("teacherId") String teacherId);

    /**
     * 签到（单）
     *
     * @param studentId
     * @param type
     * @param classRecordId
     * @return
     */
    @POST("/mobile/teacher/setStudentRecord")
    Call<BaseResult<String>> singleStudentSign(@Query("studentId") String studentId, @Query("type") String type, @Query("classRecordId") String classRecordId);

    /**
     * 签到（多）
     *
     * @param studentId
     * @param type
     * @param classRecordId
     * @return
     */
    @FormUrlEncoded
    @POST("/mobile/teacher/setAllStudentRecord")
    Call<BaseResult<String>> batchStudentSign(@Field(value = "studentId") String studentId, @Query("type") String type, @Query("classRecordId") String classRecordId);

    /**
     * 上传课堂评价接口
     *
     * @param position
     * @param parts
     * @param classShapeText
     * @param classPerformanceEvaluation
     * @param classRecordId
     * @param studentId
     * @param recorderDuration
     * @return
     */
    @Multipart
    @POST("/mobile/teacher/setStudentEvaluation/{position}")
    Call<BaseResult<String>> classroomEvaluate(@Path("position") int position, @Part List<MultipartBody.Part> parts, @Query("classShapeText") String classShapeText, @Query("classPerformanceEvaluation") int classPerformanceEvaluation,
                                               @Query("classRecordId") String classRecordId, @Query("studentId") String studentId, @Query("recorderDuration") float recorderDuration);

    /**
     * 获取课堂评价接口
     *
     * @param classRecordId
     * @param studentId
     * @return
     */
    @POST("/mobile/teacher/getStudentEvaluation")
    Call<BaseResult<StudentSignBottomInfo>> getClassroomEvaluate(@Query("classRecordId") String classRecordId, @Query("studentId") String studentId);

    /**
     * 上传纸质证明接口
     *
     * @param classRecordId
     * @param studentId
     * @param file
     * @return
     */
    @Multipart
    @POST("/mobile/teacher/paperCertificate")
    Call<BaseResult<String>> upLoadPaperCertificate(@Query("classRecordId") String classRecordId, @Query("studentId") String studentId, @Part MultipartBody.Part file);

    /**
     * 获取聊天内容接口
     *
     * @param aqid
     * @return
     */
    @POST("/mobile/answerquestion/getListMsgByaqid")
    Call<List<NeteaseIM>> getListMsgByaqid(@Query("aqId") String aqid);

    @GET("/homework/getHomeworkMsgBySessionIdNew")
    Call<BaseResult<HomeworkDetailInfo>> getHomeworkMsgBySessionId(@Query("sessionId") String sessionId);

    @POST("/homework/submit")
    Call<BaseResult<Boolean>> submitHomework(@Query("sessionId") String sessionId);

    @POST("/homework/confirmFinishByParent")
    Call<BaseResult<Boolean>> confirmFinishByParent(@Query("sessionId") String sessionId);

    @POST("/mobile/answerquestion/commentTeacher")
    Call<BaseResult<AnswerQuestionItem>> commentTeacher(@Query("aqId") String aqId, @Query("star") int star, @Query("comment") String comment);

    @POST("/mobile/revokeMsg")
    Call<BaseResult<Boolean>> revokeMsg(@Query("msgIdArray") String msgIdArray);

    /**
     * 获取版本信息接口
     *
     * @return
     */
    @POST("/mobile/teacher/version")
    Call<BaseResult<CurrentVersionInfo>> getVersion();

    /**
     * 获取发布作业状态
     *
     * @param classId
     * @return
     */
    @POST("/mobile/teacher/getClassHomeworkIsPublish")
    Call<BaseResult<Boolean>> getClassHomeworkIsPublish(@Query("classId") String classId);

    /**
     * 获取当前作业列表
     *
     * @return
     */
    @POST("/homework/classlist")
    Call<BaseResult<List<CurrentHomeWorkOutsideInfo>>> getHomeworkOutsideData();
    /**
     * 获取当前作业列表
     *
     * @return
     */
    @POST("/homework/findHwPublishByuserId")
    Call<BaseResult<List<CurrentHomeWorkOutsideInfo>>> findHwPublishByuserId();
    /**
     * 获取历史作业（最外部）
     *
     * @return
     */
    @POST("/mobile/teacher/getAllMyClasses")
    Call<BaseResult<List<HistoryHomeWorkOutsideInfo>>> getHistoryHomeworkOutsideData();

    /**
     * 获取历史作业课时列表
     *
     * @param classId
     * @return
     */
    @POST("/mobile/teacher/getHistoryHomeworkByClassId")
    Call<BaseResult<List<HistoryHomeWorkClassHourInfo>>> getHistoryHomeworkClassHourData(@Query("classId") String classId);

    /**
     * 获取新作业发布记录
     *
     * @param classId
     * @return
     */
    @POST("/homework/findHwPublishByClassId")
    Call<BaseResult<List<HistoryHomeWorkClassHourInfo>>> getNewHomeworkClassHourData(@Query("classId") String classId);


    @POST("/mobile/resetTicket")
    Call<BaseResult<ClientUserInfo>> resetTicket();

    /**
     * 发布作业
     * @param userId
     * @param description
     * @param classId
     * @param files
     * @return
     */
    @Multipart
    @POST("/homework/publishFromWeb")
    Call<BaseResult<PublishHomeworkResurtInfo>> publishFromWeb(@Query("userId") String userId, @Query("description") String description,
                                                               @Query("classId") String classId, @PartMap Map<String, RequestBody> files);
    /**
     * 批量发布作业
     * @param userId
     * @param description
     * @param classIds
     * @param files
     * @return
     */
    @Multipart
    @POST("/homework/publishHomeworkFromClasss")
    Call<BaseResult<PublishHomeworkResurtInfo>> publishHomeworkFromClasss(@Query("userId") String userId, @Query("description") String description,
                                                               @Query("classIds") List<String> classIds, @PartMap Map<String, RequestBody> files);
    /**
     * 补发作业
     * @param userId
     * @param description
     * @param classId
     * @param files
     * @param classRecordId
     * @return
     */
    @Multipart
    @POST("/homework/reissuePublish")
    Call<BaseResult<PublishHomeworkResurtInfo>> reissuePublish(@Query("userId") String userId, @Query("description") String description,
                                            @Query("classId") String classId, @PartMap Map<String, RequestBody> files,@Query("classRecordId") String classRecordId);
    /**
     * 给该班级没有收到作业的同学补发最近一次的作业
     * @param hwId
     * @param classId
     * @return
     */
    @POST("/homework/homeworkReplacement")
    Call<BaseResult<Boolean>> homeworkReplacement(@Query("hwId") String hwId, @Query("classId") String classId);
    @POST("/homework/getWordsNameBySessionId")
    Call<BaseResult<ArrayList<String>>> getWordsNameBySessionId(@Query("sessionId") String sessionId);

    @POST("/homework/boundWrongQuestionsBySessionIdAndWordName")
    Call<BaseResult<Boolean>> boundWrongQuestionsBySessionIdAndWordName(@Query("sessionId") String sessionId,@Query("wordName") String wordName ,@Query("studentUserId") String studentUserId);

    /**
     *
     * @param file 文件
     * @param filename 文件名（图片链接最后面的）
     * @param sessionId
     * @param errors 错误原因数组
     * @param studentAccId
     * @param imMsgId   服务器返回数据id值
     * @return
     */
    @Multipart
    @POST("/homework/homeworkCorrectupload")
    Call<BaseResult<Boolean>> homeworkCorrectupload(@Part MultipartBody.Part file ,
                                                    @Part("filename") RequestBody filename,@Part("sessionId") RequestBody sessionId
            ,@Part("errors") RequestBody errors, @Part("studentAccId") RequestBody studentAccId,@Part("imMsgId") RequestBody imMsgId);

    /**
     * 截止作业
     * @param sessionId
     * @return
     */
    @POST("/homework/homeworkStop")
    Call<BaseResult<Boolean>> homeworkStop(@Query("sessionId") String sessionId);

    /**
     * 获取点评文案
     * @param type
     * @return
     */
    @POST("/mobile/getDictByType")
    Call<BaseResult<List<DictByType>>> getDictByType(@Query("type")String type);

    @Multipart
    @POST("/homework/homeworkCorrectComplete")
    Call<BaseResult<Boolean>> homeworkCorrectComplete(@Part("sessionId") RequestBody sessionId , @Part("studentAccId") RequestBody studentAccId ,
                                                      @Part("fontlevel") RequestBody fontlevel,@Part("hwlevel") RequestBody hwlevel ,@Part("comments") RequestBody comments,@Part("type") RequestBody type);


    /**
     * 个人注册
     * @param userInfo
     * @return
     */
    @POST("/mobile/teacher/user/register")
    Call<BaseResult<Boolean>> personRegister(@Body ClientUserInfo userInfo);

    /**
     * 机构注册
     * @param entity
     * @return
     */
    @POST("/mobile/teacher/registerOrganization")
    Call<BaseResult<String>> registerOrganization(@Body SysOfficeEntity entity);

    /**
     * 反馈
     * @param versionCode
     * @param feedback
     * @return
     */
    @Multipart
    @POST("/mobile/teacher/feedback")
    Call<BaseResult<Boolean>> feedback(@Query("versionCode") int versionCode,@Part("feedback") RequestBody feedback);

    @POST("/mobile/notice")
    Call<BaseResult<List<InfomMessageInfo>>> getInfomMessageInfo();

    @POST("/mobile/teacher/getClassNoticeById")
    Call<BaseResult<List<VerifyMessageInfo>>> getVerifyMessageInfo();



    @POST("/mobile/teacher/addClass")
    Call<BaseResult<String>> addClass(@Body CreateRequestInfo userInfo,@Query("type")int type);


    @POST("/mobile/answerquestion/setAQStatus")
    Call<BaseResult<String>> setAQStatus(@Query("aqId") String aqId,@Query("status") String status);

    @POST("/mobile/ConsentOrRefuseInsertClass")
    Call<BaseResult<Boolean>> agreeOrRejectAddClass(@Query("classNoticeId") String classNoticeId , @Query("status") int status);

    @POST("/mobile/teacher/getUnreadSeClassNoticeByUserTeacherId")
    Call<BaseResult<Integer>> getUnreadMessageNumber();

    /**
     * 获取机构用户参数
     * @return
     */
    @POST("/mobile/teacher/getTeacherInfoByPhone")
    Call<BaseResult<ClientUserInfo>> getOrganizationUserInfo(@Query("loginName") String loginName);
    /**
     * 获取所有机构
     * @return
     */
    @POST("/mobile/company/getAllCompany")
    Call<BaseResult<List<ClientUserInfo>>> getAllCompany();
}
